package cn.edu.xmu.oomall.customer.microservice;

import cn.edu.xmu.oomall.customer.microservice.vo.CouponActivityRetVo;
import cn.edu.xmu.oomall.customer.microservice.vo.CouponActivityVoInfo;
import cn.edu.xmu.oomall.customer.model.vo.PageVo;
import cn.edu.xmu.privilegegateway.annotation.util.InternalReturnObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author XJX
 * @date 2021-12-9 20:39:15
 */

/**
 * @modifiedBy Jiazhe Yuan
 * @date 2021-12-22 01:00:06
 * @modify 修改listCouponActivitiesByProductId的返回值
 */
@FeignClient(name = "coupon-service")
public interface CouponActivityService {

    /**
     * 查看优惠活动详情
     *
     * @param id 活动id
     * @return 优惠活动详情CouponActivityVoInfo对象
     */
    @GetMapping("internal/couponactivities/{id}")
    InternalReturnObject<CouponActivityVoInfo> getCouponActivityById(@PathVariable(name = "id") Long id);

    /**
     * 查看优惠活动详情
     *
     * @param productId 商品id
     * @return 优惠活动详情CouponActivityVoInfo对象
     */
    @GetMapping("/products/{id}/couponactivities")
    InternalReturnObject<PageVo<CouponActivityRetVo>> listCouponActivitiesByProductId(@PathVariable("id") Long productId,
                                                                                      @RequestParam(value = "page", required = false, defaultValue = "1") Integer pageNumber,
                                                                                      @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize);
}

/**
 * modifiedBy Haotian Cheng 2021-12-14 13:15:08 增加通过商品ID查优惠活动方法
 */
